<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改收租费用')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-expense-edit" th:object="${sysExpense}">
            <input name="expenseId" th:field="*{expenseId}" type="hidden">
            <input id="apportionRatio" th:field="*{apportionRatio}" name="apportionRatio" class="form-control" type="hidden" readonly>
            <!------------------------------------------------------------基本信息---------------------------------------------------------->
            <h4 class="form-header h4">基本信息</h4>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">楼栋：</label>
                    <div class="col-sm-8">
                        <input name="buildingName" th:field="*{buildingName}" class="form-control" type="text" readonly>
<!--                        <div class="input-group">-->
<!--                            <select disabled id="building" class="form-control" required readonly="readonly">-->
<!--                                <option value="">&#45;&#45;请选择楼栋&#45;&#45;</option>-->
<!--                                <option th:each="building:${building}" th:value="${building.buildingId}" th:text="${building.buildingName}"></option>-->
<!--                            </select>-->
<!--                        </div>-->
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">单元号：</label>
                    <div class="col-sm-8">
                        <input name="unitNameStr" th:field="*{unitNameStr}" class="form-control" type="text" readonly>
<!--                        <div class="input-group">-->
<!--                            <select disabled id="unit" class="form-control noselect2 selectpicker" data-none-selected-text="请选择单元" readonly="readonly" multiple>-->
<!--                                <option value="" th:text="*{unitNameStr}"></option>-->
<!--                            </select>-->
<!--                        </div>-->
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">租户名称：</label>
                    <div class="col-sm-8">
                        <input name="tenantName" th:field="*{tenantName}" class="form-control" type="text" readonly>
<!--                        <div class="input-group">-->
<!--                            <select disabled id="tenantName" class="form-control noselect2 selectpicker" data-none-selected-text="请选择租户" readonly="readonly">-->
<!--                                <option value="" th:text="*{tenantName}"></option>-->
<!--                            </select>-->
<!--                        </div>-->
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">单元用途：</label>
                    <div class="col-sm-8">
                        <label class="radio-box"> <input type="radio" name="tenantUse" id="live" value="0" th:checked="${sysExpense.tenantUse == '0' ? true : false}" disabled/> 宿舍 </label>
                        <label class="radio-box"> <input type="radio" name="tenantUse" id="store" value="1" th:checked="${sysExpense.tenantUse == '1' ? true : false}" disabled/> 个人 </label>
                        <label class="radio-box"> <input type="radio" name="tenantUse" id="office" value="2" th:checked="${sysExpense.tenantUse == '2' ? true : false}" disabled/> 企业 </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">面积：</label>
                    <div class="col-sm-8">
                        <input id="tenantArea" th:field="*{tenantArea}" name="tenantArea" class="form-control" type="text" required readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">公摊比例：</label>
                    <div class="col-sm-8">
                        <input id="apportionRatioTemp" th:value="${apportionRatio}" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">本月应收租金：</label>
                    <div class="col-sm-8">
                        <input id="monthlyRentFee" th:field="*{monthlyRentFee}" name="monthlyRentFee" class="form-control" type="text" required readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">本月实收租金：</label>
                    <div class="col-sm-8">
                        <input id="realMonthlyRentFee" th:field="*{realMonthlyRentFee}" name="realMonthlyRentFee" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">本月应收物业费：</label>
                    <div class="col-sm-8">
                        <input id="propertyFee" th:field="*{propertyFee}"  name="propertyFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">本月实收物业费：</label>
                    <div class="col-sm-8">
                        <input id="realPropertyFee" th:field="*{realPropertyFee}" name="realPropertyFee" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">90%本月实收租金：</label>
                    <div class="col-sm-8">
                        <input id="ninetyPercentRealMonthlyFee" th:field="*{ninetyPercentRealMonthlyFee}" name="ninetyPercentRealMonthlyFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                </div>
            </div>
            <!------------------------------------------------------------电费信息---------------------------------------------------------->
            <h4 class="form-header h4">电费信息</h4>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">上月电表度数：</label>
                    <div class="col-sm-8">
                        <input id="lastMonthEletableNumber" th:field="*{lastMonthEletableNumber}" name="lastMonthEletableNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月电表度数：</label>
                    <div class="col-sm-8">
                        <input id="thisMonthEletableNumber" th:field="*{thisMonthEletableNumber}" name="thisMonthEletableNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月用电度数：</label>
                    <div class="col-sm-8">
                        <input id="useElectricNumber" th:field="*{useElectricNumber}" name="useElectricNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">电公摊基数：</label>
                    <div class="col-sm-8">
                        <input id="electricApportionBaseNumber" th:field="*{electricApportionBaseNumber}" name="electricApportionBaseNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊电度数：</label>
                    <div class="col-sm-8">
                        <input id="apportionElectricNumber" th:field="*{apportionElectricNumber}" name="apportionElectricNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">总用电数：</label>
                    <div class="col-sm-8">
                        <input id="totalElectricNumber" th:field="*{totalElectricNumber}" name="totalElectricNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">电费单价：</label>
                    <div class="col-sm-8">
                        <input id="electricUninPrice" th:field="*{electricUninPrice}" name="electricUninPrice" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">自用电费：</label>
                    <div class="col-sm-8">
                        <input id="useElectricFee" th:field="*{useElectricFee}" name="useElectricFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊电费：</label>
                    <div class="col-sm-8">
                        <input id="apportionElectricFee" th:field="*{apportionElectricFee}" name="apportionElectricFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                </div>
            </div>
            <!------------------------------------------------------------水费信息---------------------------------------------------------->
            <h4 class="form-header h4">水费信息</h4>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">上月水表度数：</label>
                    <div class="col-sm-8">
                        <input id="lastMonthWatableNumber" th:field="*{lastMonthWatableNumber}" name="lastMonthWatableNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月水表度数：</label>
                    <div class="col-sm-8">
                        <input id="thisMonthWatableNumber" th:field="*{thisMonthWatableNumber}" name="thisMonthWatableNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月用水度数：</label>
                    <div class="col-sm-8">
                        <input id="useWaterNumber" th:field="*{useWaterNumber}" name="useWaterNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">水公摊基数：</label>
                    <div class="col-sm-8">
                        <input id="waterApportionBaseNumber" th:field="*{waterApportionBaseNumber}" name="waterApportionBaseNumber" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊水度数：</label>
                    <div class="col-sm-8">
                        <input id="apportionWaterNumber" th:field="*{apportionWaterNumber}" name="apportionWaterNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">总用水数：</label>
                    <div class="col-sm-8">
                        <input id="totalWaterNumber" th:field="*{totalWaterNumber}" name="totalWaterNumber" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">水费单价：</label>
                    <div class="col-sm-8">
                        <input id="waterUninPrice" th:field="*{waterUninPrice}" name="waterUninPrice" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">自用水费：</label>
                    <div class="col-sm-8">
                        <input id="useWaterFee" th:field="*{useWaterFee}" name="useWaterFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊水费：</label>
                    <div class="col-sm-8">
                        <input id="apportionWaterFee" th:field="*{apportionWaterFee}" name="apportionWaterFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                </div>
            </div>

            <h4 class="form-header h4">收费合计</h4>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">自用水电费用合计：</label>
                    <div class="col-sm-8">
                        <input id="useTotalUtilityFee" th:field="*{useTotalUtilityFee}" name="useTotalUtilityFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公摊水电费用合计：</label>
                    <div class="col-sm-8">
                        <input id="apportionTotalUtilityFee" th:field="*{apportionTotalUtilityFee}" name="apportionTotalUtilityFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">水电费用合计：</label>
                    <div class="col-sm-8">
                        <input id="totalUtilityFee" th:field="*{totalUtilityFee}" name="totalUtilityFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-sm-offset-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">宽带费用：</label>
                    <div class="col-sm-8">
                        <input id="wlanFee" th:field="*{wlanFee}" name="wlanFee" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">本月实收金额：</label>
                    <div class="col-sm-8">
                        <input id="totalMonthRealFee" th:field="*{totalMonthRealFee}" name="totalMonthRealFee" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <th:block th:include="include :: expense-edit-js" />

    <script type="text/javascript">
        var apportionRatioOver = $("#apportionRatio").val();
        var prefix = ctx + "system/expense";
        $("#form-expense-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-expense-edit').serialize());
            }
        }

        // --------------------------------------------------------------------渲染-----------------------------------------------------------------
        $(function() {
            $('#building').select2({
                placeholder: "请选择楼栋",
                allowClear: true,
            });
            $('#unit').selectpicker({
                'width':'300px'
            });
            $('#tenantName').selectpicker({
                'width':'300px'
            });
        });

    </script>
</body>
</html>